﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;

namespace Scavenger
{
    class Pointer
    {
        /* Class description
         * The pointer class initializes with a Texture2D.
         * It traces mouse movements and state through the update method,
         * and draws the texture on that location.
         */

        public MouseState State;
        public Vector2 Position;
        public int Width, Height;

        Texture2D Texture;

        public void Initialize(Texture2D texture)
        {
            this.Texture = texture;
            Width = this.Texture.Width;
            Height = this.Texture.Height;

            // Probably something more intelligent here
            State = Mouse.GetState();
            Position = new Vector2(State.X, State.Y);
        }

        public void Update(GameTime gameTime, MouseState mouseState)
        {
            State = mouseState;
            Position = new Vector2(State.X, State.Y);
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Texture, Position, Color.White);
        }
    }
}
